<template>
  <a-config-provider :locale="locale">
  <div id="app">
    <router-view/>
  </div>
  </a-config-provider>
</template>

<script>
  import { domTitle, setDocumentTitle } from '@/utils/domUtil'
  import { i18nRender } from '@/locales'
  // 以下3句作用于日期控件显示中文
  import moment from 'moment'
  import 'moment/locale/zh-cn'
  moment.locale('zh-cn')
export default {
  data () {
    return {
    }
  },

  computed: {
    locale () {
      // 只是为了切换语言时，更新标题
      const { title } = this.$route.meta
      title && (setDocumentTitle(`${i18nRender(title)} - ${domTitle}`))

      // 原先的en-US改成zh-CN即可
      return this.$i18n.getLocaleMessage('zh-CN').antLocale
    }
  }
}
</script>
<style>
  .ant-layout-footer{
    display: none;
  }

  .ant-pro-grid-content {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .ant-pro-page-header-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .ant-pro-page-header-wrap-children-content {
    display: flex;
    flex: 1;
  }
</style>
